﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace Common.DataAnnotations
{
    /// <summary>
    /// 邮箱或者手机号
    /// </summary>
    public class EmailOrMoblieAttribute : RegularExpressionAttribute
    {
        const string EmailOrMobliePattern = @"^((\w-*\.*)+@(\w-?)+(\.\w{2,})+)|(1\d{10})$";
        /// <summary>
        /// 邮箱或者手机号
        /// </summary>
        public EmailOrMoblieAttribute() : base(EmailOrMobliePattern)
        {
        }
    }
}
